home *** CD-ROM | disk | FTP | other *** search
/ Programmers Heaven 2 / Programmers Heaven 2.iso / files / windows / ocx / ipack.exe / FTPCONNE.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-02-17  |  6.2 KB  |  201 lines

  1. VERSION 2.00
  2. Begin Form frmConnection 
  3.    BackColor       =   &H00C0C0C0&
  4.    ClientHeight    =   3000
  5.    ClientLeft      =   1740
  6.    ClientTop       =   2835
  7.    ClientWidth     =   3645
  8.    ControlBox      =   0   'False
  9.    Height          =   3405
  10.    Left            =   1680
  11.    LinkTopic       =   "Form2"
  12.    MaxButton       =   0   'False
  13.    MDIChild        =   -1  'True
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   3000
  16.    ScaleWidth      =   3645
  17.    Top             =   2490
  18.    Width           =   3765
  19.    WindowState     =   2  'Maximized
  20.    Begin CommandButton cmdConnect 
  21.       Caption         =   "Connect"
  22.       FontBold        =   0   'False
  23.       FontItalic      =   0   'False
  24.       FontName        =   "MS Sans Serif"
  25.       FontSize        =   8.25
  26.       FontStrikethru  =   0   'False
  27.       FontUnderline   =   0   'False
  28.       Height          =   375
  29.       Left            =   105
  30.       TabIndex        =   6
  31.       Top             =   1725
  32.       Width           =   975
  33.    End
  34.    Begin CommandButton cmdDisconnect 
  35.       Caption         =   "Disconnect"
  36.       Enabled         =   0   'False
  37.       FontBold        =   0   'False
  38.       FontItalic      =   0   'False
  39.       FontName        =   "MS Sans Serif"
  40.       FontSize        =   8.25
  41.       FontStrikethru  =   0   'False
  42.       FontUnderline   =   0   'False
  43.       Height          =   375
  44.       Left            =   1185
  45.       TabIndex        =   5
  46.       Top             =   1725
  47.       Width           =   975
  48.    End
  49.    Begin CommandButton cmdReinit 
  50.       Caption         =   "Reinit"
  51.       Enabled         =   0   'False
  52.       FontBold        =   0   'False
  53.       FontItalic      =   0   'False
  54.       FontName        =   "MS Sans Serif"
  55.       FontSize        =   8.25
  56.       FontStrikethru  =   0   'False
  57.       FontUnderline   =   0   'False
  58.       Height          =   375
  59.       Left            =   2265
  60.       TabIndex        =   4
  61.       Top             =   1725
  62.       Width           =   975
  63.    End
  64.    Begin TextBox txtHost 
  65.       Height          =   285
  66.       Left            =   1065
  67.       TabIndex        =   3
  68.       Top             =   45
  69.       Width           =   2175
  70.    End
  71.    Begin TextBox txtUsername 
  72.       Height          =   285
  73.       Left            =   1065
  74.       TabIndex        =   2
  75.       Top             =   405
  76.       Width           =   2175
  77.    End
  78.    Begin TextBox txtPassword 
  79.       Height          =   285
  80.       Left            =   1065
  81.       TabIndex        =   1
  82.       Top             =   765
  83.       Width           =   2175
  84.    End
  85.    Begin TextBox txtAccount 
  86.       Height          =   285
  87.       Left            =   1065
  88.       TabIndex        =   0
  89.       Top             =   1125
  90.       Width           =   2175
  91.    End
  92.    Begin Timer Timer1 
  93.       Interval        =   100
  94.       Left            =   105
  95.       Top             =   2325
  96.    End
  97.    Begin Label Label1 
  98.       Alignment       =   1  'Right Justify
  99.       BackColor       =   &H00C0C0C0&
  100.       Caption         =   "Host:"
  101.       FontBold        =   0   'False
  102.       FontItalic      =   0   'False
  103.       FontName        =   "MS Sans Serif"
  104.       FontSize        =   8.25
  105.       FontStrikethru  =   0   'False
  106.       FontUnderline   =   0   'False
  107.       Height          =   255
  108.       Left            =   105
  109.       TabIndex        =   10
  110.       Top             =   45
  111.       Width           =   855
  112.    End
  113.    Begin Label Label2 
  114.       Alignment       =   1  'Right Justify
  115.       BackColor       =   &H00C0C0C0&
  116.       Caption         =   "Username:"
  117.       FontBold        =   0   'False
  118.       FontItalic      =   0   'False
  119.       FontName        =   "MS Sans Serif"
  120.       FontSize        =   8.25
  121.       FontStrikethru  =   0   'False
  122.       FontUnderline   =   0   'False
  123.       Height          =   255
  124.       Left            =   105
  125.       TabIndex        =   9
  126.       Top             =   405
  127.       Width           =   855
  128.    End
  129.    Begin Label Label3 
  130.       Alignment       =   1  'Right Justify
  131.       BackColor       =   &H00C0C0C0&
  132.       Caption         =   "Password:"
  133.       FontBold        =   0   'False
  134.       FontItalic      =   0   'False
  135.       FontName        =   "MS Sans Serif"
  136.       FontSize        =   8.25
  137.       FontStrikethru  =   0   'False
  138.       FontUnderline   =   0   'False
  139.       Height          =   255
  140.       Left            =   105
  141.       TabIndex        =   8
  142.       Top             =   765
  143.       Width           =   855
  144.    End
  145.    Begin Label Label4 
  146.       Alignment       =   1  'Right Justify
  147.       BackColor       =   &H00C0C0C0&
  148.       Caption         =   "Account:"
  149.       FontBold        =   0   'False
  150.       FontItalic      =   0   'False
  151.       FontName        =   "MS Sans Serif"
  152.       FontSize        =   8.25
  153.       FontStrikethru  =   0   'False
  154.       FontUnderline   =   0   'False
  155.       Height          =   255
  156.       Left            =   105
  157.       TabIndex        =   7
  158.       Top             =   1125
  159.       Width           =   855
  160.    End
  161. Option Explicit
  162. Dim fConnected As Integer
  163. Dim foo As Integer
  164. Private Sub cmdConnect_Click ()
  165.     MainForm.FTP1.Host = txtHost.Text
  166.     MainForm.FTP1.LogonName = txtUsername.Text
  167.     MainForm.FTP1.LogonPassword = txtPassword.Text
  168.     MainForm.FTP1.Account = txtAccount.Text
  169.     cmdConnect.Enabled = False
  170.     If (ExecuteCommand(FtpActionConnect) <> 0) Then
  171.         cmdConnect.Enabled = True
  172.     End If
  173. End Sub
  174. Private Sub cmdDisconnect_Click ()
  175.     Dim foo As Integer
  176.     foo = ExecuteCommand(FtpActionDisconnect)
  177. End Sub
  178. Private Sub cmdReinit_Click ()
  179.     foo = ExecuteCommand(FtpActionReinitialize)
  180. End Sub
  181. Private Sub Form_Load ()
  182.     txtHost.Text = "ftp.mabry.com"
  183.     txtUsername.Text = "anonymous"
  184.     txtPassword.Text = "test@ftp.ocx"
  185.     fConnected = False
  186.     Me.Show
  187. End Sub
  188. Private Sub Timer1_Timer ()
  189.     If (fConnected = False And MainForm.FTP1.State = 1) Then
  190.         cmdDisconnect.Enabled = True
  191.         cmdConnect.Enabled = False
  192.         cmdReinit.Enabled = True
  193.         fConnected = True
  194.     ElseIf (fConnected = True And MainForm.FTP1.State = 0) Then
  195.         cmdDisconnect.Enabled = Not True
  196.         cmdConnect.Enabled = Not False
  197.         cmdReinit.Enabled = Not True
  198.         fConnected = False
  199.     End If
  200. End Sub
  201.